package com.ruoyi.system.mapper.ingredients;

import com.ruoyi.system.domain.ingredients.PartIngredients;
import com.ruoyi.system.domain.ingredients.PartIngredientsDetail;
import com.ruoyi.system.domain.ingredients.PartIngredientsException;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 辅料Mapper接口
 * 
 * @author ljx
 * @date 2020-07-01
 */
public interface PartIngredientsMapper 
{
    /**
     * 查询辅料
     * 
     * @param id 辅料ID
     * @return 辅料
     */
    public PartIngredients selectPartIngredientsById(Long id);

    /**
     * 查询辅料列表
     * 
     * @param partIngredients 辅料
     * @return 辅料集合
     */
    public List<PartIngredients> selectPartIngredientsList(PartIngredients partIngredients);
    public List<PartIngredients> selectPartIngredientsListAllByName(PartIngredients partIngredients);
    
    public List<PartIngredients> selectPartIngredientsListAll();
    
    public List<PartIngredients> selectPartIngredientsListBySubNameAndName(PartIngredients partIngredients);

    /**
     * 新增辅料
     * 
     * @param partIngredients 辅料
     * @return 结果
     */
    public int insertPartIngredients(PartIngredients partIngredients);

    /**
     * 修改辅料
     * 
     * @param partIngredients 辅料
     * @return 结果
     */
    public int updatePartIngredients(PartIngredients partIngredients);

    /**
     * 删除辅料
     * 
     * @param id 辅料ID
     * @return 结果
     */
    public int deletePartIngredientsById(Long id);

    /**
     * 批量删除辅料
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deletePartIngredientsByIds(String[] ids);

    /**
     * 修改库存
     */
    int updateInventory(@Param("data") PartIngredientsDetail partIngredientsDetail);

    int updateInventoryFromExc(@Param("data") PartIngredientsException part);
}
